<script setup>
const props = defineProps({
  curIndex:{
    type:Number,
    default:0
  }
})
  const list = [{
  "pagePath":"/pages/teachers/page1",
  "iconPath":"/static/list/tu12.png",
  "selectedIconPath":"/static/list/tu11.png",
  "text":"批次统计"
  },
  {
  "pagePath":"/pages/teachers/page2",
  "iconPath":"/static/list/tu22.png",
  "selectedIconPath":"/static/list/tu21.png",
  "text":"离校审批"
  },
  {
  "pagePath":"/pages/teachers/page3",
  "iconPath":"/static/list/tu32.png",
  "selectedIconPath":"/static/list/tu31.png",
  "text":"留校签到"
  },
  {
  "pagePath":"/pages/teachers/page4",
  "iconPath":"/static/list/tu32.png",
  "selectedIconPath":"/static/list/tu31.png",
  "text":"返校报到"
  },
  {
  "pagePath":"/pages/teachers/page9",
  "iconPath":"/static/list/tu42.png",
  "selectedIconPath":"/static/list/tu41.png",
  "text":"更多功能"
  },
  ]
  const toTabbar = (path) => {
    uni.switchTab({
      url: path
    })
  }
</script>

<template>
  <view class="tbm">
    <view v-for="(item,index) in list" :key="index" @click="toTabbar(item.pagePath)">
      <view style="text-align: center">
        <image v-if="index != props.curIndex" class="tbimg" :src="item.iconPath"></image>
        <image v-else class="tbimg" :src="item.selectedIconPath"></image>
      </view>
      <view>
        {{item.text}}
      </view>
    </view>
  </view>
</template>

<style scoped lang="scss">
.tbm{
  background-color: white;
  color: #666666;
  font-size: 10px;
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-around;
}
.tbimg{
  width: 28px;
  height: 28px;
}
</style>